package com.example.boot.modules.system.dto;

import com.example.starter.webmvc.valid.CreateValid;
import com.example.starter.webmvc.valid.UpdateValid;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 *
 * @author 王令
 * @since 2022-10-21
 */
@Data
public class TenantDto implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = {UpdateValid.class})
    private Long id;

    /**
     * 租户id
     */
    @NotEmpty(message = "租户id不能为空", groups = {UpdateValid.class, CreateValid.class})
    @Size(max = 32, message = "租户id长度不能超过32")
    private String tenantId;

    /**
     * 租户名
     */
    @NotEmpty(message = "租户名不能为空", groups = {CreateValid.class, UpdateValid.class})
    @Size(max = 32, message = "租户名长度不能超过32", groups = {UpdateValid.class, CreateValid.class})
    private String name;

    /**
     * logo
     */
    private String logo;

    /**
     * 状态
     */
    private Boolean enabled;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    /**
     * 过期时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;


}
